<?php

class Admin_Acl_Acl extends Zend_Acl
{
	public function __construct()
	{
		//Resources
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::GUEST_PAGE));
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::USER_PAGE));
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::ADMIN_PAGE));
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::EMP_WH_PAGE));
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::EMP_CS_PAGE));
		$this->add(new Zend_Acl_Resource(Admin_Acl_Resource::EMP_FN_PAGE));
		
		//Roles
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::GUEST));
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::USER),Admin_Acl_Role::GUEST);
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::EMP_WH),Admin_Acl_Role::GUEST);
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::EMP_CS),Admin_Acl_Role::GUEST);
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::EMP_FN), array(Admin_Acl_Role::EMP_CS, Admin_Acl_Role::EMP_WH));
		$this->addRole(new Zend_Acl_Role(Admin_Acl_Role::ADMIN), array(Admin_Acl_Role::USER, Admin_Acl_Role::EMP_FN));
		
		$this->allow(Admin_Acl_Role::GUEST, Admin_Acl_Resource::GUEST_PAGE);
		
		$this->allow(Admin_Acl_Role::USER, Admin_Acl_Resource::USER_PAGE);
		
		$this->allow(Admin_Acl_Role::EMP_WH, Admin_Acl_Resource::EMP_WH_PAGE);
		
		$this->allow(Admin_Acl_Role::EMP_CS, Admin_Acl_Resource::EMP_CS_PAGE);
		
		$this->allow(Admin_Acl_Role::EMP_FN, Admin_Acl_Resource::EMP_FN_PAGE);
				
		$this->allow(Admin_Acl_Role::ADMIN, Admin_Acl_Resource::ADMIN_PAGE);
	}
}